import requests

from common.get_header import get_header
from common.get_range_tel import get_rand_tel


class Ihrm_Add_Staff(object):
    @classmethod
    def add_staff_api(cls, add_data, header):
        res = requests.post(url='https://heimahr.itheima.net/api/sys/user',
                            headers=header,
                            json=add_data)
        return res


if __name__ == '__main__':
    header=get_header()
    tel = get_rand_tel()
    add_data = {"username": "黑马程序", "mobile": tel, "workNumber": "", "formOfEmployment": '1',
                "departmentId": '14', "timeOfEntry": "2025-03-03", "correctionTime": "2025-06-07T16:00:00.000Z",
                "staffPhoto": ""}
    resp = Ihrm_Add_Staff.add_staff_api(add_data,header)
    print(resp.json())
